from django.urls import path
from .views import examinee_views, auth_views, api_views, notification_views

app_name = 'exam_system'  # 添加应用命名空间

urlpatterns = [
    # 考试相关URL
    path('exams/', examinee_views.exam_list, name='exam_list'),
    path('exams/available/', examinee_views.available_exams, name='available_exams'),
    path('exams/register/<int:exam_room_id>/', examinee_views.register_exam, name='register_exam'),
    path('exam/<int:exam_room_id>/take/', examinee_views.take_exam, name='take_exam'),
    path('exam/<int:exam_room_id>/start/', examinee_views.take_exam, name='start_exam'),
    path('exam/submit-answer/', examinee_views.submit_answer, name='submit_answer'),
    path('exam/paper/<int:paper_id>/submit/', examinee_views.submit_exam, name='submit_exam'),
    path('exam/<int:exam_room_id>/result/', examinee_views.exam_result, name='exam_result'),
    path('exam/<int:exam_room_id>/detail/', examinee_views.exam_detail, name='exam_detail'),
    path('exam/check-status/', examinee_views.check_exam_status, name='check_exam_status'),
    # API endpoints
    path('api/subject/<int:subject_id>/stats/', api_views.get_subject_question_stats, name='subject_question_stats'),
    path('', examinee_views.dashboard, name='index'),
    path('register/', auth_views.register, name='register'),
    path('login/', auth_views.login, name='login'),
    path('logout/', auth_views.logout, name='logout'),
    path('dashboard/', examinee_views.dashboard, name='dashboard'),
    path('profile/', examinee_views.profile, name='profile'),

    # 通知相关
    path('notifications/', notification_views.notification_list, name='notification_list'),
    path('notification/<int:notification_id>/mark-read/', notification_views.mark_notification_as_read, name='mark_notification_read'),
]